﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Pibby.Core.IO.Tests
{
	[TestClass]
	public class DriveMaskTranslatorTests
	{
		[TestMethod]
		public void DriveMaskTranslator_CanIdentify_SingleDrive()
		{
			Assert.AreEqual('A', DriveMaskTranslator.IdentifyDriveLetter(0x1));
			Assert.AreEqual('B', DriveMaskTranslator.IdentifyDriveLetter(0x2));
			Assert.AreEqual('C', DriveMaskTranslator.IdentifyDriveLetter(0x4));
			Assert.AreEqual('D', DriveMaskTranslator.IdentifyDriveLetter(0x8));
			Assert.AreEqual('E', DriveMaskTranslator.IdentifyDriveLetter(0x10));
			Assert.AreEqual('F', DriveMaskTranslator.IdentifyDriveLetter(0x20));
			Assert.AreEqual('G', DriveMaskTranslator.IdentifyDriveLetter(0x40));
			Assert.AreEqual('H', DriveMaskTranslator.IdentifyDriveLetter(0x80));
		}

		[TestMethod]
		public void DriveMaskTranslator_BlankDriveMask_IsUnknown()
		{
			Assert.AreEqual('?', DriveMaskTranslator.IdentifyDriveLetter(0));
		}
	}
}
